﻿using UnityEngine;
using System.Collections;

public class PlayerInputMgr : BaseSingleton<PlayerInputMgr>
{
    public PlayerBehaviour player;
    // Use this for initialization
    void Awake()
    {
    }

    // Update is called once per frame
    void Update()
    {
        if (Permission.canInput)
        {
            if (Input.GetKey(KeyCode.Mouse0))
            {
                //  player.fire();
            }

            if (Input.GetKeyDown(KeyCode.R))
            {
                //player.reload();
            }

            //if (Input.GetKey(KeyCode.A))
            //{
            //    player.setHorizontalAAxis(1);
            //}

            //if (Input.GetKey(KeyCode.D))
            //{
            //    player.setHorizontalAAxis(-1);
            //}
            player.setHorizontalAAxis(Input.GetAxisRaw("Horizontal"));
            if (Input.GetKeyDown(KeyCode.W))
            {
                //player.moveToUpperLayer();
            }

            if (Input.GetKey(KeyCode.S))
            {
                //player.moveToLowerLayer();
            }

            if (Input.GetKeyDown(KeyCode.LeftShift))
            {
                player.dash();
            }
            if (Input.GetKeyDown(KeyCode.Space))
            {
                player.startJump();
            }
            //if(Input.GetKey(KeyCode.Space))
            //{
            //    player.holdJump();
            //}
            if (Input.GetKeyUp(KeyCode.Space))
            {
                player.stopJump();
            }
        }
    }
}
